<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="sec"
	uri="http://www.springframework.org/security/tags"%>

<sec:authentication property="principal" var="currentPrincipal"
	scope="page" />

<div class="modal-dialog ms-modal-dialog">
	<div class="modal-content">

		<div class="modal-header">
			<button type="button" class="close" data-dismiss="modal">
				<span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
			</button>
			<h4 class="modal-title">&nbsp;-&nbsp;过滤查询</h4>
		</div>

		<form class="form-horizontal ms-form form-personal-info" method="GET"
			action="${ctx.host}/reports">

			<input type="hidden" name="filter" value="true" />
			<!--<input type="hidden" name="status" value="${status}" />-->

			<div class="modal-body">

				<div class="form-group  ms-form-group">
					<label class="control-label col-xs-3">订单号：</label>
					<div class="col-xs-8 pull-left role-login-name">
						<input type="text" class="form-control" name="code"
							placeholder="订单号" tabindex="5" autocomplete="off" />
					</div>
				</div>
				<div class="form-group  ms-form-group">
					<label class="control-label col-xs-3">alamo订单号：</label>
					<div class="col-xs-8 pull-left role-login-name">
						<input type="text" class="form-control" name="alamoCode"
							placeholder="alamo订单号" tabindex="5" autocomplete="off" />
					</div>
				</div>
				<div class="form-group  ms-form-group">
					<label class="control-label col-xs-3">下单时间：</label>
					<div class="col-xs-8 common-date">
						<input type="text" name="beginCreateTime"
							class="form-control date" placeholder="开始时间" autocomplete="off" />
						<label class="control-label">到：</label> <input type="text"
							name="endCreateTime" class="form-control date" placeholder="结束时间"
							autocomplete="off">
					</div>
				</div>

				<div class="form-group  ms-form-group">
					<label class="control-label col-xs-3">国家：</label>
					<div class="col-xs-8">
						<!--<input type="text" class="form-control" name="country"
							tabindex="2" placeholder="国家" autocomplete="off" />-->
					<select class="select2 form-control" name="country" tabindex="3"> 
             		 	<option></option>
	          	    		<c:forEach items="${countries}" var="country">
	                			<option value="${country.code}">${country.englishName} - ${country.chineseName}</option>
	              			</c:forEach>
              		</select>
					</div>
				</div>

				<div class="form-group  ms-form-group">
					<label class="control-label col-xs-3">品牌：</label>
					<div class="col-xs-8">
						<select class="select2 form-control" name="brand" tabindex="3"> 
              					<option></option>
	              				<c:forEach items="${suppliers}" var="suppliers">
	               				<option value="${suppliers.code}">${suppliers.engliashName} - ${suppliers.chineseName}</option>
	              				</c:forEach>
              			</select>
					</div>
				</div>

				<!--<div class="form-group  ms-form-group">
          	<label class="control-label col-xs-3">取车时间：</label>
          		<div class="col-xs-8 common-date">
            		<input type="text" name="beginPickupDate" class="form-control date" placeholder="开始时间" autocomplete="off"/>
            		<label class="control-label">到：</label>
            		<input type="text" name="endPickupDate" class="form-control date" placeholder="结束时间" autocomplete="off">
          		</div>
        	</div>-->

				<!--<div class="form-group  ms-form-group">
          	<label class="control-label col-xs-3">还车时间：</label>
          		<div class="col-xs-8 common-date">
            		<input type="text" name="beginReturnDate" class="form-control date" placeholder="开始时间" autocomplete="off"/>
            		<label class="control-label">到：</label>
            		<input type="text" name="endReturnDate" class="form-control date" placeholder="结束时间" autocomplete="off">
          		</div>
       		</div>
        -->
				<!--<div class="form-group  ms-form-group">
          	<label class="control-label col-xs-3">取车地点：</label>
          		<div class="col-xs-8 pull-left role-login-name">
           	 		<input type="text" class="form-control" name="pickupLocation" placeholder="取车地点" tabindex="5" autocomplete="off"/>
          		</div>
        	</div>
        
        	<div class="form-group  ms-form-group">
          	<label class="control-label col-xs-3">还车地点：</label>
          		<div class="col-xs-8 pull-left role-login-name">
            		<input type="text" class="form-control" name="returnLocation" placeholder="还车地点" tabindex="6" autocomplete="off"/>
          		</div>
        	</div>-->

				<div class="form-group ms-form-group">
					<label class="col-xs-3 control-label">预付/到付：</label>
					<div class="col-xs-8">
						<select name="type" class="select2 form-control" tabindex="7">
							<option></option>
							<c:forEach var="payType" items="${enums['PayType']}">
								<option value="${payType}"
									${payType == order.type ? 'selected' : ''}>${payType.description}</option>
							</c:forEach>
						</select>
					</div>
				</div>

				<!--	<div class="form-group  ms-form-group">
          	<label class="control-label col-xs-3">车型：</label>
          		<div class="col-xs-8 pull-left role-login-name">
            		<input type="text" class="form-control" name="vehicleType" placeholder="车型" tabindex="8" autocomplete="off"/>
          		</div>
        	</div>
        
        
        	<div class="form-group  ms-form-group">
          	<label class="control-label col-xs-3">订单金额：</label>
          		<div class="col-xs-8 pull-left role-login-name">
            		<input type="text" class="form-control" name="payPrice" placeholder="订单金额" tabindex="9" autocomplete="off"/>
          		</div>
        	</div>-->

				<!--	<div class="form-group  ms-form-group">
          	<label class="control-label col-xs-3">成本价：</label>
          		<div class="col-xs-8 pull-left role-login-name">
            		<input type="text" class="form-control" name="costPrice" placeholder="成本价" tabindex="10" autocomplete="off"/>
          	</div>
        	</div>-->

				<div class="form-group  ms-form-group">
					<label class="control-label col-xs-3">代理人：</label>
					<div class="col-xs-8 pull-left role-login-name">
						<input type="text" class="form-control" name="agentName"
							placeholder="代理人" tabindex="11" autocomplete="off" />
					</div>
				</div>

				<div class="form-group ms-form-group">
					<label class="col-xs-3 control-label">订单状态：</label>
					<div class="col-xs-8">
						<select name="status" class="select2 form-control" tabindex="7" multiple="multiple">
							<option></option>
							<c:forEach var="orderStatus" items="${enums['OrderStatus']}">
								<option value="${orderStatus}"
									${orderStatus == order.status ? 'selected' : ''}>${orderStatus.description}</option>
							</c:forEach>
						</select>
					</div>
				</div>

				<!--<div class="form-group  ms-form-group">
          	<label class="control-label col-xs-3">代理返点：</label>
          		<div class="col-xs-8 pull-left role-login-name">
            		<input type="text" class="form-control" name="rebate" placeholder="代理返点" tabindex="12" autocomplete="off"/>
          		</div>
        	</div>-->

			</div>

			<div class="modal-footer ms-modal-footer">
				<button type="submit" class="btn ms-btn btn-primary">确定</button>
				<button type="button" class="btn ms-btn ms-btn-gary"
					data-dismiss="modal">取消</button>
			</div>

		</form>

	</div>
</div>
<script type="text/javascript">
  $(document).ready(function () {
  	 $('select[name="country"]').select2({
      theme: "classic",
      placeholder : '请选择国家',
      minimumResultsForSearch : 5,
      allowClear : true
    });
    
  	 $('select[name="brand"]').select2({
      theme: "classic",
      placeholder : '请选择品牌',
      minimumResultsForSearch : 5,
      allowClear : true
    });
	   $('select[name="type"]').select2({
		      theme: "classic",
		      placeholder : '请选择',
		      minimumResultsForSearch : -1,
		      allowClear : true
		    });
		     $('select[name="status"]').select2({
		      theme: "classic",
		      placeholder : '请选择',
		      minimumResultsForSearch : -1,
		      allowClear : true
		    });
	    $('.date').datetimepicker({
            format: 'yyyy-mm-dd',
            autoclose: true,
            language: 'zh-CN',
            todayBtn: 'linked',
            startDate: '${today}',
            todayHighlight: true,
            pickerPosition: 'bottom-right',
            minView: 'month'
          });
  })
</script>